package com.navi.heartbeat.entity;

import java.sql.Timestamp;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;

/**
 * SystemAlarm
 *
 * @author Matthew
 * @date 2018-07-03
 */
@Entity
@Table(name = "system_alarm", schema = "ch_qms", catalog = "")
public class SystemAlarm {

  private Integer id;
  private Timestamp evtTimestamp;
  private String sys;
  private String errorCode;
  private String errorDesc;
  private String errorMsg;
  private String shopId;
  private String fileIndexUrl;
  private Integer severity;
  private String jobName;
  private String etlTimestamp;
  private String timeOut;
  private String realTimeOut;

  @Id
  @GeneratedValue(strategy = GenerationType.IDENTITY)
  @Column(name = "ID", nullable = false)
  public Integer getId() {
    return id;
  }

  public void setId(Integer id) {
    this.id = id;
  }

  @Basic
  @Column(name = "EVT_TIMESTAMP", nullable = true)
  public Timestamp getEvtTimestamp() {
    return evtTimestamp;
  }

  public void setEvtTimestamp(Timestamp evtTimestamp) {
    this.evtTimestamp = evtTimestamp;
  }

  @Basic
  @Column(name = "SYS", nullable = true, length = 20)
  public String getSys() {
    return sys;
  }

  public void setSys(String sys) {
    this.sys = sys;
  }

  @Basic
  @Column(name = "ERROR_CODE", nullable = true, length = 7)
  public String getErrorCode() {
    return errorCode;
  }

  public void setErrorCode(String errorCode) {
    this.errorCode = errorCode;
  }

  @Basic
  @Column(name = "ERROR_DESC", nullable = true, length = 200)
  public String getErrorDesc() {
    return errorDesc;
  }

  public void setErrorDesc(String errorDesc) {
    this.errorDesc = errorDesc;
  }

  @Basic
  @Column(name = "ERROR_MSG", nullable = true, length = -1)
  public String getErrorMsg() {
    return errorMsg;
  }

  public void setErrorMsg(String errorMsg) {
    this.errorMsg = errorMsg;
  }

  @Basic
  @Column(name = "SHOP_ID", nullable = true, length = 6)
  public String getShopId() {
    return shopId;
  }

  public void setShopId(String shopId) {
    this.shopId = shopId;
  }

  @Basic
  @Column(name = "FILE_INDEX_URL", nullable = true, length = 100)
  public String getFileIndexUrl() {
    return fileIndexUrl;
  }

  public void setFileIndexUrl(String fileIndexUrl) {
    this.fileIndexUrl = fileIndexUrl;
  }

  @Basic
  @Column(name = "SEVERITY", nullable = true)
  public Integer getSeverity() {
    return severity;
  }

  public void setSeverity(Integer severity) {
    this.severity = severity;
  }
  @Basic
  @Column(name = "JOB_NAME", nullable = true)
  public String getJobName() {
    return jobName;
  }

  public void setJobName(String jobName) {
    this.jobName = jobName;
  }
  @Basic
  @Column(name = "START_END_TIMESTAMP", nullable = true)
  public String getEtlTimestamp() {
    return etlTimestamp;
  }

  public void setEtlTimestamp(String etlTimestamp) {
    this.etlTimestamp = etlTimestamp;
  }
  @Basic
  @Column(name = "TIME_OUT", nullable = true)
  public String getTimeOut() {
    return timeOut;
  }

  public void setTimeOut(String timeOut) {
    this.timeOut = timeOut;
  }
  @Basic
  @Column(name = "REAL_TIME_OUT", nullable = true)
  public String getRealTimeOut() {
    return realTimeOut;
  }

  public void setRealTimeOut(String realTimeOut) {
    this.realTimeOut = realTimeOut;
  }

  @Override
  public boolean equals(Object o) {
    if (this == o) {
      return true;
    }
    if (o == null || getClass() != o.getClass()) {
      return false;
    }

    SystemAlarm that = (SystemAlarm) o;

    if (id != null ? !id.equals(that.id) : that.id != null) {
      return false;
    }
    if (evtTimestamp != null ? !evtTimestamp.equals(that.evtTimestamp) : that.evtTimestamp != null) {
      return false;
    }
    if (sys != null ? !sys.equals(that.sys) : that.sys != null) {
      return false;
    }
    if (errorCode != null ? !errorCode.equals(that.errorCode) : that.errorCode != null) {
      return false;
    }
    if (errorDesc != null ? !errorDesc.equals(that.errorDesc) : that.errorDesc != null) {
      return false;
    }
    if (errorMsg != null ? !errorMsg.equals(that.errorMsg) : that.errorMsg != null) {
      return false;
    }
    if (shopId != null ? !shopId.equals(that.shopId) : that.shopId != null) {
      return false;
    }
    if (fileIndexUrl != null ? !fileIndexUrl.equals(that.fileIndexUrl) : that.fileIndexUrl != null) {
      return false;
    }
    if (severity != null ? !severity.equals(that.severity) : that.severity != null) {
      return false;
    }

    if (jobName != null ? !jobName.equals(that.jobName) : that.jobName != null) {
      return false;
    }
    if (etlTimestamp != null ? !etlTimestamp.equals(that.etlTimestamp) : that.etlTimestamp != null) {
      return false;
    }
    if (timeOut != null ? !timeOut.equals(that.timeOut) : that.timeOut != null) {
      return false;
    }
    if (realTimeOut != null ? !realTimeOut.equals(that.realTimeOut) : that.realTimeOut != null) {
      return false;
    }

    return true;
  }

  @Override
  public int hashCode() {
    int result = id != null ? id.hashCode() : 0;
    result = 31 * result + (evtTimestamp != null ? evtTimestamp.hashCode() : 0);
    result = 31 * result + (sys != null ? sys.hashCode() : 0);
    result = 31 * result + (errorCode != null ? errorCode.hashCode() : 0);
    result = 31 * result + (errorDesc != null ? errorDesc.hashCode() : 0);
    result = 31 * result + (errorMsg != null ? errorMsg.hashCode() : 0);
    result = 31 * result + (shopId != null ? shopId.hashCode() : 0);
    result = 31 * result + (fileIndexUrl != null ? fileIndexUrl.hashCode() : 0);
    result = 31 * result + (severity != null ? severity.hashCode() : 0);
    result = 31 * result + (jobName != null ? jobName.hashCode() : 0);
    result = 31 * result + (etlTimestamp != null ? etlTimestamp.hashCode() : 0);
    result = 31 * result + (timeOut != null ? timeOut.hashCode() : 0);
    result = 31 * result + (realTimeOut != null ? realTimeOut.hashCode() : 0);
    return result;
  }
}
